<?php
define("APPLICATION_PATH", realpath(dirname(__FILE__) . "/../application/"));
set_include_path(APPLICATION_PATH . "/../library" . PATH_SEPARATOR . APPLICATION_PATH . "/../application/controllers". PATH_SEPARATOR . APPLICATION_PATH . "/../application/models". PATH_SEPARATOR . get_include_path());
require_once('../ini/constants.php');
require_once('Config/Http.php');
require_once('Config/Config.php');
require_once('Config/Tools.php');

require_once('Logs/Logs.php');
	

// config object
$config = new config();
$parameters = config::_instal_ini();
$smarty = config::_get_smarty_obj();

tools::_assign("settings",array('css'=>"../skins/0000/0000.css"));
	
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $parameters['admin']['user'] != $_SERVER['PHP_AUTH_USER'] || $parameters['admin']['pass'] != md5($_SERVER['PHP_AUTH_PW']))
	{
	header("WWW-Authenticate: Basic realm=Logowanie do systemu");
	header("HTTP/1.0 401 Unauthorized");

	tools::_display('section/const_header.tpl');
}else{
	tools::_display('section/const_header.tpl');
	
	echo '	
		<div id="header"></div>
		<div id="content-wrap" class="one-col"  >		
		<div id="main">
		
		';
			
	include_once 'Updates.php';
	$u = new UpdatesController();	
	$u->indexAction();
	echo '</div></div>';
	tools::_display('section/const_fotter.tpl');
}

